package com.briup.api.client;

import com.briup.api.domain.dto.OrderItemInsertDTO;
import com.briup.api.domain.pojo.Goods;
import com.briup.api.domain.vo.GoodsGetDetailVO;
import com.briup.common.response.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Collection;
import java.util.List;

@FeignClient("bstore-item")
public interface ItemClient {
    //批量查询多个商品详细信息
    @GetMapping("/goods/batch")
    List<Goods> queryItemByIds(@RequestParam("ids") Collection<Integer> ids);

    //批量扣减商品库存
    @PutMapping("/goods/updateStock")
    Result updateStock(@RequestBody List<OrderItemInsertDTO> items);

    //查询指定商品详细信息
    @GetMapping("/goods/{id}")
    Result<GoodsGetDetailVO> getGoodsDetail(@PathVariable Integer id);
}
